/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MessageHandler;

/**
 *
 * @author maniksin
 */
public enum submessage {
   NOT_APPLICABLE(0, null, false),
   EXTERNAL_COMMAND(1, "exec", false),
    ANNOUNCEMENT(2, "announce", false),
    LIST_COMMANDS(3, "list_commands", true);
    
    public int sub_message;
    public String cmd;
    public boolean supported_on_self;
    
    submessage(int sub, String cmd, boolean self_support) {
        sub_message = sub;
        this.cmd = cmd;
        supported_on_self = self_support;
    }
    
    public static submessage get_submessage(int value) {
        
        for (submessage s : submessage.values()) {
            if (value == s.sub_message) {
                return s;
            }
        }
        
        return null;
        
    }
     
}
